import { _decorator, Component, Label, Node, Sprite } from 'cc';
import { Soldier } from '../entity/Soldier';
const { ccclass, property } = _decorator;

@ccclass('SoldierItem')
export class SoldierItem extends Component {
    @property(Sprite)
    public cover:Sprite;
    @property(Label)
    public soldierName:Label;
    @property(Label)
    public count:Label;
    start() {

    }

    async setData(s: Soldier){
        this.soldierName.string = s.name
        this.count.string = s.count + ''
        this.cover.spriteFrame = await s.getHeadImg()
       
    }
}


